package com.example.springboot_calculator.web;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CalculatorController {
    //加法
    @RequestMapping(value ="/add")
    public Object add(Integer a,Integer b){
        return a+b;
    }
    //减法
    @RequestMapping(value ="/sub")
    public Object sub(Integer a,Integer b){
        return a-b;
    }
    //乘法
    @RequestMapping(value ="/multiply")
    public Object multiply(Integer a,Integer b){
        return a*b;
    }
    //除法
    @RequestMapping(value ="/division")
    public Object division(Integer a,Integer b){
        return a/b;
    }

}
